﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/BaseMaster.Master" Inherits="System.Web.Mvc.ViewPage<TeamDoer.Models.ShareTaskListModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Share task list - <%: Model.TaskListName %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<div class="workdiv">
    <h2>Share "<%: Model.TaskListName %>"</h2>

	<p>Enter one or more email addresses (separate with comma) to share this list with them!</p>

	<% using (Html.BeginForm()) { %>
		<textarea name="emails" rows="2" style="width:100%"></textarea>
		<br />
		<input type="submit" value="share" />
	<% } %>

	<%= ViewData["message"] %>

	<% if (Model.SharedUserNames.Any()) { %>
		<p class="small">
		Already shared with: <%= Model.SharedUserNames.Select(element => element.DisplayName).Aggregate((current, next) => current + ", " + next)%>
		</p>
	<% } %>
</div>
</asp:Content>
